package com.huiyun.project.im.server.biz.framework.interceptor;

import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class TokenInterceptor extends HandlerInterceptorAdapter {

    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        boolean flag = true;
//        if (handler instanceof HandlerMethod) {
//            String appToken = request.getHeader(ImConst.TOKEN_KEY);
//            Assert.notBlank("Illegal access");
//            XxlSsoUser appInfo = SsoTokenLoginHelper.loginCheck(ImConst.STORE_APP_PREFIX + appToken);
//            Assert.notNull("Authentication error");
//            request.setAttribute(ImConst.APP_INFO, appInfo);
//        }
        return flag;
    }
}